﻿using System.Collections.Generic;
using SARS.Biz.Facades;
using SARS.DAO;
using SARS.Entity;

namespace SARS.Biz
{
    public class GroupBO : IGroupBO
    {
        private readonly GroupDAO groupDAO = new GroupDAO();

        public int CreateGroup(string groupName, int courseId)
        {
            var group = new GroupEntity();
            group.GroupName = groupName;
            group.CourseID = courseId;

            return groupDAO.CreateGroup(group);
        }

        public bool UpdateGroup(GroupEntity group)
        {
            return groupDAO.UpdateGroup(group);
        }

        public void RemoveGroup(int groupId)
        {
            groupDAO.RemoveGroup(groupId);
        }

        public List<GroupEntity> RetriveAllGroup()
        {
            return groupDAO.RetriveAllGroup();
        }

        public GroupEntity RetrieveGroupById(int groupId)
        {
            return groupDAO.RetrieveGroupById(groupId);
        }

        public List<GroupEntity> RetriveAllGroupByCourseId(int courseId)
        {
            return groupDAO.RetriveAllGroupByCourseId(courseId);
        }

        public void AssignGroupTutor(int groupId, int manageId)
        {
            groupDAO.AssignGroupTutor(groupId, manageId);
        }

        public void AssignStudentsIntoGroup(int groupId, int coordinatorId, List<string> listStudentId)
        {
            groupDAO.AssignStudentsIntoGroup(groupId, coordinatorId, listStudentId);
        }

        public void RemoveGroupTutor(int groupId, int managerId)
        {
            groupDAO.RemoveGroupTutor(groupId, managerId);
        }

        public void RemoveStudentGroup(int groupId, int studentId)
        {
            groupDAO.RemoveStudentGroup(groupId, studentId);
        }
    }
}